package com.cocotingo.snail.dispatcher;

class Blocker {
	
	private boolean unlocked_flag;
	
	public Blocker() {
		unlocked_flag = false;
	}
	
	public synchronized void lock() throws InterruptedException {
		if (!unlocked_flag) {
			wait();
		}
	}
	
	public synchronized void unlock() {
		unlocked_flag = true;
		notify();
	}

}
